﻿<baseview:BaseView x:Class="CharacterCreation.Views.CharacterSkillsView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:baseview="clr-namespace:CharacterCreation.Views.Contracts"             
    xmlns:controls="clr-namespace:CharacterCreation.Controls">
    
    <Grid x:Name="LayoutRoot">
        <controls:ListBox ItemsSource="{Binding Character.Skills}" SelectedItem="{Binding CharacterSkill, Mode=TwoWay}" Background="Transparent" Grid.Column="0" >
            <controls:ListBox.CustomItemTemplate>
                <DataTemplate>
                    <Grid Background="Transparent" Height="30">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="75" />
                        </Grid.ColumnDefinitions>
                        <TextBlock Text="{Binding Skill.Name}" Margin="5" Foreground="White" VerticalAlignment="Center" />
                    </Grid>
                </DataTemplate>
            </controls:ListBox.CustomItemTemplate>

            <controls:ListBox.SelectedItemTemplate>
                <DataTemplate>
                    <Grid Background="AliceBlue" Height="30">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="75" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <TextBlock Text="{Binding Skill.Name}" Margin="5" Foreground="Black" VerticalAlignment="Center" />
                        <Button Style="{StaticResource actionButton}" Command="{Binding ElementName=LayoutRoot, Path=DataContext.EditSkillCommand}" 
                                Grid.Column="1" ToolTip="Details">
                            <Image Source="/Images/ctron_eigenschappen_32.png" Height="16" Width="16" VerticalAlignment="Center"/>
                        </Button>
                    </Grid>
                </DataTemplate>
            </controls:ListBox.SelectedItemTemplate>
        </controls:ListBox>
    </Grid>
</baseview:BaseView>
